#include "StdAfx.h"
#include "enumtable_d3d.h"

DWORD primitiveTypeLookupTable[ATOM_RenderAttributes::PrimitiveType_Count] = {
	0,
	D3DPT_TRIANGLELIST,
	D3DPT_TRIANGLESTRIP,
	D3DPT_TRIANGLEFAN,
	D3DPT_LINELIST,
	D3DPT_LINESTRIP,
	D3DPT_POINTLIST
};

DWORD shadeModeLookupTable[ATOM_RenderAttributes::ShadeMode_Count] = {
	0,
	D3DSHADE_FLAT,
	D3DSHADE_GOURAUD
};

DWORD blendFuncLookupTable[ATOM_RenderAttributes::BlendFunc_Count] = {
	0,
	D3DBLEND_ZERO,
	D3DBLEND_ONE,
	D3DBLEND_SRCCOLOR,
	D3DBLEND_INVSRCCOLOR,
	D3DBLEND_SRCALPHA,
	D3DBLEND_INVSRCALPHA,
	D3DBLEND_DESTALPHA,
	D3DBLEND_INVDESTALPHA,
	D3DBLEND_DESTCOLOR,
	D3DBLEND_INVDESTCOLOR,
	D3DBLEND_BLENDFACTOR,
	D3DBLEND_INVBLENDFACTOR
};

DWORD blendOpLookupTable[ATOM_RenderAttributes::BlendOp_Count] = {
	0,
	D3DBLENDOP_ADD,
	D3DBLENDOP_SUBTRACT,
	D3DBLENDOP_REVSUBTRACT,
	D3DBLENDOP_MIN,
	D3DBLENDOP_MAX
};

DWORD compareFuncLookupTable[ATOM_RenderAttributes::CompareFunc_Count] = {
	0,
	D3DCMP_NEVER,
	D3DCMP_ALWAYS,
	D3DCMP_LESS,
	D3DCMP_LESSEQUAL,
	D3DCMP_GREATER,
	D3DCMP_GREATEREQUAL,
	D3DCMP_EQUAL,
	D3DCMP_NOTEQUAL
};

DWORD stencilOpLookupTable[ATOM_RenderAttributes::StencilOp_Count] = {
	0,
	D3DSTENCILOP_KEEP,
	D3DSTENCILOP_ZERO,
	D3DSTENCILOP_REPLACE,
	D3DSTENCILOP_INCRSAT,
	D3DSTENCILOP_DECRSAT,
	D3DSTENCILOP_INVERT,
	D3DSTENCILOP_INCR,
	D3DSTENCILOP_DECR
};

DWORD fillModeLookupTable[ATOM_RenderAttributes::FillMode_Count] = {
	0,
	D3DFILL_SOLID,
	D3DFILL_WIREFRAME
};

DWORD samplerFilterLookupTable[ATOM_RenderAttributes::SamplerFilter_Count][3] = {
	{ 0, 0 },
	{ D3DTEXF_POINT, D3DTEXF_POINT, D3DTEXF_POINT },
	{ D3DTEXF_POINT, D3DTEXF_POINT, D3DTEXF_LINEAR },
	{ D3DTEXF_POINT, D3DTEXF_POINT, D3DTEXF_NONE },
	{ D3DTEXF_POINT, D3DTEXF_LINEAR, D3DTEXF_POINT },
	{ D3DTEXF_POINT, D3DTEXF_LINEAR, D3DTEXF_LINEAR },
	{ D3DTEXF_POINT, D3DTEXF_LINEAR, D3DTEXF_NONE },
	{ D3DTEXF_LINEAR, D3DTEXF_POINT, D3DTEXF_POINT },
	{ D3DTEXF_LINEAR, D3DTEXF_POINT, D3DTEXF_LINEAR },
	{ D3DTEXF_LINEAR, D3DTEXF_POINT, D3DTEXF_NONE },
	{ D3DTEXF_LINEAR, D3DTEXF_LINEAR, D3DTEXF_POINT },
	{ D3DTEXF_LINEAR, D3DTEXF_LINEAR, D3DTEXF_LINEAR },
	{ D3DTEXF_LINEAR, D3DTEXF_LINEAR, D3DTEXF_NONE },
	{ D3DTEXF_ANISOTROPIC, D3DTEXF_LINEAR, D3DTEXF_POINT },
	{ D3DTEXF_ANISOTROPIC, D3DTEXF_LINEAR, D3DTEXF_LINEAR },
	{ D3DTEXF_ANISOTROPIC, D3DTEXF_LINEAR, D3DTEXF_NONE }
};

DWORD samplerAddressLookupTable[ATOM_RenderAttributes::SamplerAddress_Count] = {
	0,
	D3DTADDRESS_WRAP,
	D3DTADDRESS_CLAMP,
	D3DTADDRESS_MIRROR,
	D3DTADDRESS_BORDER,
	D3DTADDRESS_MIRRORONCE
};

DWORD textureOpLookupTable[ATOM_RenderAttributes::TextureOp_Count] = {
	0,
	D3DTOP_DISABLE,
	D3DTOP_SELECTARG1,
	D3DTOP_MODULATE,
	D3DTOP_MODULATE2X,
	D3DTOP_MODULATE4X,
	D3DTOP_ADD,
	D3DTOP_ADDSIGNED,
	D3DTOP_SUBTRACT,
	D3DTOP_DOTPRODUCT3,
	D3DTOP_LERP
};

DWORD textureArgLookupTable[ATOM_RenderAttributes::TextureArg_Count] = {
	0,
	D3DTA_TFACTOR,
	D3DTA_CURRENT,
	D3DTA_DIFFUSE,
	D3DTA_TEXTURE
};

DWORD textureCoordGenLookupTable[ATOM_RenderAttributes::TexCoordGen_Count] = {
	0,
	D3DTSS_TCI_SPHEREMAP,
	D3DTSS_TCI_PASSTHRU,
	D3DTSS_TCI_PASSTHRU|0,
	D3DTSS_TCI_PASSTHRU|1,
	D3DTSS_TCI_PASSTHRU|2,
	D3DTSS_TCI_PASSTHRU|3,
	D3DTSS_TCI_PASSTHRU|4,
	D3DTSS_TCI_PASSTHRU|5,
	D3DTSS_TCI_PASSTHRU|6,
	D3DTSS_TCI_PASSTHRU|7,
};

DWORD fogModeLookupTable[ATOM_RenderAttributes::FogMode_Count] = {
	0,
	D3DFOG_NONE,
	D3DFOG_LINEAR,
	D3DFOG_EXP,
	D3DFOG_EXP2
};

